1. Field of the Invention
The present invention is directed to the field of numerical control. More specifically, the invention is directed to an apparatus for and a method of carrying out positioning of a machine or the like under numerical control using a servo loop, and compensating for a positioning error thereof.
2. Description of the Background Art
The numerical control system shown in FIG. 5 has an automatic tuning function which automatically adjusts or sets control parameters, such as a servo loop gain, in a servo control loop used to control the position of a table. This control apparatus is described in more detail in U.S. Pat. No. 5,285,378, which is herein incorporated by reference. As shown in FIG. 5, a numerical control apparatus 1 outputs a position command signal to a servo amplifier 2 to control the operation of motor 3, thereby controlling the position of table 6. The magnitude of the drive current flowing through the motor 3 is detected by motor current detector 4 as the motor 3 is driven by servo amplifier 2. A ballscrew 5 is caused to rotate by the rotation of the motor 3. Table 6, which is fitted with the ballscrew 5, moves as the ballscrew 5 rotates. A table position detecting means 7, such as a table position detector, detects the position of the table 6 as it moves along ballscrew 5. A motor rotation position detecting means 9, such as a motor detector, detects the position of the table 6 on the basis of the output signal of an encoder mounted on the rotary shaft of the motor 3.
As described in the aforementioned co-pending application, the numerical control apparatus 1 is equipped with an automatic tuning section 8 that allows the numerical control apparatus 1 to select one or more of a plurality of control parameters, such as a compensation position command signal, to sample the selected control parameter at predetermined times, and to store the result into a control parameter memory 1b of the numerical control apparatus 1. Specifically, data sampling controller 1a provided in the numerical control apparatus proper selects any of the control parameters indicating the level of a velocity command signal and a current command signal (internal signals of the servo amplifier 2), a position signal output by the table position detector 7, a position signal output by the motor end detector 9, a velocity signal output by the velocity detecting means 91, a current signal output by the motor current detector 4, and other signals under the command of the tuning section 8, samples the selected parameter at a predetermined timing, and stores the result into a control parameter memory 1b of the numerical control apparatus. The control parameters output by the automatic tuning section 8 are similarly stored into the control parameter memory 1b.
The automatic tuning section is coupled to the numerical control apparatus 1 via signal line 10a and interface unit 10. The automatic tuning section 8 includes an internal data storage section 12 for storing status information of the numerical control apparatus 1, and the contents of the control parameter memory 1b. An optimum parameter value calculating section 13 is provided for determining whether the control parameters have reached optimum values based on the information stored in the internal data storage section 12, and for calculating an optimum value if such parameters are not at their optimum levels. A parameter change control section 14 is provided for setting the value of the control parameter calculated by the optimum parameter value calculating section 13, and transmitting the parameter value thus calculated to the control parameter memory 1b via interface 10 and signal line 10a. A test run control section 15 is provided for selecting an appropriate test run operation mode depending on the control parameter to be adjusted or set, and controlling a test run operation. When used herein, the term "test run" refers to the loop controlled movement of table 6 prior to an actual machining operation on a workpiece secured to the table. Such test runs are used to determine whether or not the control parameters are appropriate, and to set the control parameters accordingly. A general control section 11 is used to control the general operation of the components making up the automatic tuning section 8.
FIG. 6 illustrates the servo amplifier 2 in more detail. In general, the servo amplifier 2 functions to control the current flowing through the motor 3 based on the position command signal output from the numerical control apparatus 1, thereby controlling the position of the table 6. The amplifier 2 also functions to compensate for backlash in the mechanical positioning system (i.e., motor 3, ballscrew 5, and table 6). In response to the position command signal output from the numerical control apparatus 1, a travel direction/reversal timing outputting means 35 outputs a signal indicative of the travel direction of the table 6, and the reversal of such travel direction. The travel direction/reversal timing outputting means comprises a travel direction signal generating means for outputting a signal indicating the travel direction of the table 6 under the control of the position command signal, and a travel direction/reversal timing signal generating means for generating a travel direction reversing timing signal which indicates the timing of reversal the travel direction. A backlash compensation memory 36 stores a value equivalent to a backlash compensation amount stored in the control parameter memory 1b of the numerical control apparatus 1. The backlash compensation amount is used to compensate for the inherent play in the connection between the ballscrew 5 and table 6. A switch circuit 37a is moved to an "ON" position upon receiving a reversal output signal generated by outputting means 35 indicative of the reversal of the table 6 travel direction.
The movement of the switch circuit 37a, which is coupled to the backlash compensation memory 36, allows the backlash compensation amount stored in the memory 36 to be added to the position command signal by adding means 31a. Adding means 31a outputs a compensated position command signal, which is a signal resulting from the addition of the position command signal and the backlash compensation amount output from memory 36. When the switch circuit 37a is moved to the "OFF" position, the position command signal output from the adding means 31a is identical to the position command signal output from the numerical control apparatus 1. A subtracting means 31b subtracts the position signal output by the motor end detector 9, or the position signal output by the table position detector 7, from the compensated position command signal output from adding means 31a. Select switch 38 determines whether the motor end detector 9 or the table position detector 7 output is to be subtracted from the compensated position command signal.
A position control section 31 generates a velocity command signal in response to the signal output from subtracting means 31b. The subtraction output signal represents a position error value which is used in generating the velocity command signal. A velocity signal generating means 91 generates a velocity signal under control of the position signal output by the motor end detector 9. A subtracting means 32a subtracts the velocity signal from the velocity command signal output by the position control section 31. A velocity control section 32 generates a current command signal in response to the velocity error value which is the subtraction output from the subtracting means 32a. A further subtracting means 33a subtracts a current signal output from motor current detector 4, from the current command signal generated by velocity control section 32. A current control section 33 outputs a signal in response to a current error value which is the subtraction signal output from subtracting means 33a. Pulse width modulator (PWM) circuit 34 modulates the output of a DC power supply having a predetermined voltage so that an average power is supplied to the motor 3 in response to the output signal of the current control section 33. The subtracting means 31b, the position control section 31, the subtracting means 32a, the velocity control section 32, the subtracting means 33a, the current control section 33 and the PWM circuit 34 constitute motor driving means.
FIG. 7(a) illustrates the relationship between the compensation position command signal and the actual machine end position as a function of the position command signal. In particular, the solid line represents the compensation position command signal, while the dashed line represents the actual machine end position. FIG. 7(b) illustrates the same relationship where backlash compensation has been performed in the manner described above. In comparing FIGS. 7(a) and 7(b), FIG. 7(b) illustrates the successful use of compensation position command signals for compensating for the backlash of the actual position, and matching the position command signal with the actual position.
FIG. 8 illustrates how the motor 3 rotates the ballscrew 5 to cause the table 6 to move. In particular, a drive force F.sub.0 is applied by the ballscrew 5 to the table 6 at the point X.sub.0 where the table 6 engages the ballscrew 5 (hereinafter referred to as the "table displacement"). The sliding resistance force F.sub.1 is applied to the table 6 by a sliding surface 16. If the acceleration of the table 6 is zero, the drive force F.sub.0 is equal to the sliding resistance force F.sub.1. Reference numeral X.sub.1 indicates the detection output of the table position detector 7 (hereinafter referred to as the "position detector end displacement"). Reference numeral X.sub.2 indicates the position of the workpiece 17 secured and supported by the table 6 (hereinafter referred to as the "machine end displacement").
FIGS. 9(a) and 9(b) illustrate how the position of the table 6 pitches and deforms depending on the travel direction of the table 6. In particular, FIG. 9(a) illustrates the positional deformation in a positive direction of travel, while FIG. 9(b) illustrates a similar deformation in a negative direction of travel. According to these figures, the position detector end displacement X.sub.1 and the machine end displacement X.sub.2 can be represented by the following equations:
For (FIG. 9(a)): EQU X.sub.1 =X.sub.0 +L.sub.1 .theta..sub.a (Equation 1) EQU X.sub.2 =X.sub.0 -L.sub.2 .theta..sub.a (Equation 2)
For (FIG. 9(b)): EQU X.sub.1 =X.sub.0 -L.sub.1 .theta..sub.b (Equation 3) EQU X.sub.2 =X.sub.0 +L.sub.2 .theta..sub.b (Equation 4)
where L.sub.1 represents the distance from the fitting area of the ballscrew 5 and the table 6 to the table position detector 7, L.sub.2 represents the distance from the fitting area to the workpiece 17, .theta..sub.a represents the positional deformation angle of the table 6, when the table travels in the positive direction, and .theta..sub.b represents the positional deformation angle of the table 6 when the table travels in the negative direction.
FIG. 10 illustrates the relationship between position detector end displacement X.sub.1 and the machine end displacement X.sub.2 as a function of the table displacement X.sub.0. In particular, the solid line represents the position detector end displacement X.sub.1, and the long/short-dashed line represents the machine end displacement X.sub.2. As shown in the figure, the position detector end displacement X.sub.1 includes a backlash component L.sub.1 (.theta..sub.a .theta..sub.b), while the machine end displacement X.sub.2 includes a backlash component L.sub.2 (.theta..sub.a +.theta..sub.b), with respect to table displacement X.sub.0.
FIG. 11 illustrates the relationship between the position detector end displacement X.sub.1 (solid line) and the machine end displacement X.sub.2 (long/short-dashed line) as a function of the position command signal at a time when switch 38 is set to the table position detector 7 position to form a full-closed loop control. Because the full-closed loop control causes the position detector end displacement X.sub.1 and the position command signal to match, a deformation error similar to backlash, although attributable to machine rigidity, occurs between the position command signal and the machine end displacement X.sub.2. An error value .DELTA.X.sub.2 (hereinafter referred to as the "machine deformation error"), which is related to machine rigidity, can therefore be represented by the following equation: EQU .DELTA.X.sub.2 =(L.sub.1 +L.sub.2) (.theta..sub.a +.theta..sub.b)(Equation 5)
The error value .DELTA.X.sub.2 can also be represented by the following equation: EQU .DELTA.X.sub.2 =2 F.sub.0 /k.sub.2 (Equation 6)
where k.sub.2 represents the machine end rigidity. This representation can be made because the positional deformation amount angles .theta..sub.a and .theta..sub.b are proportional to the moment applied to the table 6. From the above equations, it can be seen that the drive force F.sub.0 changes when the travel direction is reversed, as shown in FIG. 12. The table position detector 7 is disposed away from where the workpiece is located, there are many cases where (L1+L2) cannot be reduced, and there are many cases where angle .theta..sub.a +.theta..sub.b generated by the pitching of the table 6 is not small due to the accuracy, etc., of the mechanism section.
As shown in FIG. 13, the relationship between the position command signal and the machine end position X.sub.2 differs in error magnitude immediately after reversal of the travel direction between the required backlash compensation (continuous solid line) and the required machine deformation error compensation (long/short-dashed line); the difference in error magnitude is shown in the figure as a hatched area.
FIG. 14 illustrates the relationship between the position command signal and the machine end position X.sub.2 when a backlash compensation technique is used to compensate for the actual machine deformation error. As can be seen, the difference between the backlash compensation and the machine deformation error compensation (shown as hatched areas in FIG. 14) results in overcompensation, thereby causing a large error between the position command signal and the machine end position X.sub.2 immediately after the reversal of the travel direction.
Where X.sub.3 is the motor end detector displacement, which is output from motor end position detector 9, and the table 6 travels in a positive direction, there is the following relationship: EQU X.sub.1 -X.sub.3 =-F.sub.0 /k.sub.1 (Equation 7)
When the table 6 travels in the negative direction, the following relationship exists: EQU X.sub.1 -X.sub.3 =F.sub.0 /k.sub.1 (Equation 8)
where k.sub.1 indicates ballscrew rigidity. Hence, the deformation amount .DELTA.X.sub.1 of the ballscrew 5 at the time the table 6 reverses travel direction can be represented as follows: EQU .DELTA.X.sub.1 32 2 F.sub.0 /k.sub.1 (Equation 9)
FIG. 15(a) illustrates a change in deformation amount of the ballscrew at the reversal of the table 6 travel direction, and FIG. 15(b) shows how the velocity command signal and the velocity signal, which is the detection output of the velocity detecting means 91, change with time at the reversal of the table 6 travel direction. At the reversal of the table 6 travel direction, the difference between the velocity command signal and the velocity signal (or the detection output of the Velocity detecting means 91) deviates from a stable or constant value relative to the velocity command signal. As a result, a response delay occurs during the change of the ballscrew 5 deformation amount (shown in FIG. 15(a)).
Although the stationary value .DELTA.X.sub.1 of the ballscrew 5 deformation amount does not affect the error of machine end displacement X.sub.2 during full-closed loop operation, the response delay results in a positioning error at the time of quadrant switching, thereby reducing the machining accuracy of the workpiece 17.
One prior art attempt to solve the above response delay problem is set forth in Japanese Patent Publication No. 148315/1988. This publication, however, does not take into account the machine deformation error problem discussed above, or the problems associated with the automatic tuning compensation apparatus also discussed above.
A method of checking the sufficiency of compensation regarding machine deformation error and response delay is shown in FIGS. 16 and 17. In FIG. 16, object 171, having a circumferential surface machined with high accuracy, is fixed to table 6 via surface plate 6a. A displacement meter 18 is employed to measure the position of the circumference of the object 171. By causing the displacement meter 18 to revolve around the Z-axis, while simultaneously controlling the X- and Y-axis of the table 6 (without rotating the table), the displacement meter 18 can travel around the circumference of the object 171 and measure its displacement. Displacement meter output data processor 19 converts measurement information output from the meter 18 into information which can be processed by numerical control apparatus 1. The data processor 19 may also use the information to determine the positioning error and output the error to a plotter or the like.
The apparatus shown in FIG. 16 is similar to that shown in FIG. 5 with the exception of the surface plate 6a, object 171, displacement meter 18, and data processor 19. It follows from the above discussion that as the positioning accuracy of the table 6 increases, the change in output of the displacement meter 18 decreases. However, if it has been determined from the positioning error data output by the plotter that the position accuracy of the table 6 is not satisfactory, the appropriate control parameter values must be reset on a trial and error basis by the operator.
The prior art thus described does not require further backlash compensation, but cannot compensate for the machine deformation error under full-closed loop control, which operates to match the position command signal and the detection output of the table position detector 7. Moreover, when the prior art apparatus does compensate for machine deformation error, it does so by employing a given or set compensation amount, which does not change with time. As the machine deformation error changes in magnitude with time at the reversal of the travel direction of table 6, the matching of the position command signal with the motor end detector 9 in the semi-closed loop mode results in overcompensation. In addition, the prior art apparatus does not include means for detecting or calculating the compensation amount for the position accuracy error of table 6.